package com.itheima.blog.web.controller;

import com.itheima.blog.web.service.ITCommentService;
import com.itheima.common.domain.PageResDto;
import com.itheima.common.domain.R;
import com.itheima.common.vo.CommentPageDTO;
import com.itheima.common.vo.CommentVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/web/comment")
@Api(value = "消息相关接口", tags = {"消息相关接口"})
@Slf4j
@RequiredArgsConstructor
public class CommentController {

    private final ITCommentService commentService;

    @PostMapping("/page")
    @ApiOperation("评论分页查询")
    public PageResDto<CommentVO> page(@RequestBody CommentPageDTO dto){
        return commentService.commentPage(dto);
    }

    @DeleteMapping
    @ApiOperation("删除评论")
    public R<String> delete(List<Integer> ids){
        return commentService.delete(ids);
    }


}
